
def a=12

switch (a){
    case "foo":
        a= "foo"
        break
    case [1,2,3,""]:
        a = 'list'
        break
    case 1..100:
        a = "range"
        break
    case Integer:
        a = "Integer"
        break
    case BigDecimal:
        a = "BigDecimal"
        break
    default:a = "default"
}

println(a)

def sum = 0
//范围for 循环
for (int i in 1..9){
    sum+=i
}

println(sum)

sum = 0
//list循环
for (i in [1,2,3,5,67]){
    sum+=i
}

println(sum)
//map循环
for (i in ['lili':1,'lala':2,'lucky':3]){
    println "${i.key}-----${i.value}"
}



















